/**
 * @Author ZhangGJ
 * @Date 2021/11/14 09:50
 */
#ifndef CPP_IN_ACTION_CURRENCY_H
#define CPP_IN_ACTION_CURRENCY_H

enum SignType
{
    plus, minus
};

class Currency
{
public:

    explicit Currency(SignType theSign = plus, unsigned long theDollars = 0, unsigned int theCents = 0);

    ~Currency() = default;;

    void setValue(SignType, unsigned long, unsigned int);

    void setValue(double);

    SignType getSign() const
    {
        return sign;
    }

    unsigned long getDollars() const
    {
        return dollars;
    }

    unsigned int getCents() const
    {
        return cents;
    }

    Currency add(const Currency &) const;

    Currency &increment(const Currency &);

    void output() const;

private:
    SignType sign;
    unsigned long dollars;
    unsigned int cents;
};


#endif //CPP_IN_ACTION_CURRENCY_H
